<?php
//
//	file: includes/aucp/color_plug_modcp.php
//	begin: 30/04/2007
//	$Author: christopher $
//	$Revision: 29 $
//	$Date: 2008-07-19 15:59:35 +0000 (Sat, 19 Jul 2008) $
//	license: http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)
//
//	description: color plugs for modcp

if (!defined('IN_PHPBB'))
{
	die("Hacking attempt");
}

class color_modcp extends plug_ins
{
	function display_posts($row='', $tpl_switch='')
	{
		global $template, $colors;

		if(is_array($row))
		{
			$template->assign_lastblock_vars($tpl_switch, array(
			'S_USERNAME' => $colors->get_user_color($row['user_group_id'], $row['user_session_time']),
			));
		}

		return;
	}

	function display_ip($type='', &$sql='', $row='', $switch='')
	{
		global $template, $colors;

		if($type == 'users')
		{
			if(!empty($sql)
			{
				$sql = str_replace('SELECT ', 'SELECT u.user_group_id, u.user_session_time, ', $sql);
			}
			if(is_array($row))
			{
				$template->assign_lastblock_vars($tpl_switch, array(
					'POSTER_NAME' => $colors->get_user_color($row['user_group_id'], $row['user_session_time'], $row['username']),
				));
			}
		}
		return;
	}

}

?>